/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package jpa;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;

/**
 *
 * @author Fredy
 */
@Entity
@Table(name = "grilla")
@NamedQueries({@NamedQuery(name = "Grilla.findAll", query = "SELECT g FROM Grilla g"), @NamedQuery(name = "Grilla.findByIdGrilla", query = "SELECT g FROM Grilla g WHERE g.idGrilla = :idGrilla"), @NamedQuery(name = "Grilla.findByFilas", query = "SELECT g FROM Grilla g WHERE g.filas = :filas"), @NamedQuery(name = "Grilla.findByColumnas", query = "SELECT g FROM Grilla g WHERE g.columnas = :columnas")})
public class Grilla implements Serializable {
    private static final long serialVersionUID = 1L;

    @Id
    @Basic(optional = false)
    @Column(name = "idGrilla", nullable = false)
    @GeneratedValue(strategy = GenerationType.IDENTITY)

    private Integer idGrilla;
    @Column(name = "filas")
    private Integer filas;
    @Column(name = "columnas")
    private Integer columnas;
    @JoinColumn(name = "idDominioGeometrico", referencedColumnName = "idDominioGeometrico")
    @ManyToOne(optional = false)
    private DominioGeometrico idDominioGeometrico;

    public Grilla() {
    }

    public Grilla(Integer idGrilla) {
        this.idGrilla = idGrilla;
    }

    public Integer getIdGrilla() {
        return idGrilla;
    }

    public void setIdGrilla(Integer idGrilla) {
        this.idGrilla = idGrilla;
    }

    public Integer getFilas() {
        return filas;
    }

    public void setFilas(Integer filas) {
        this.filas = filas;
    }

    public Integer getColumnas() {
        return columnas;
    }

    public void setColumnas(Integer columnas) {
        this.columnas = columnas;
    }

    public DominioGeometrico getIdDominioGeometrico() {
        return idDominioGeometrico;
    }

    public void setIdDominioGeometrico(DominioGeometrico idDominioGeometrico) {
        this.idDominioGeometrico = idDominioGeometrico;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (idGrilla != null ? idGrilla.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Grilla)) {
            return false;
        }
        Grilla other = (Grilla) object;
        if ((this.idGrilla == null && other.idGrilla != null) || (this.idGrilla != null && !this.idGrilla.equals(other.idGrilla))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "jpa.Grilla[idGrilla=" + idGrilla + "]";
    }

}
